package com.heima.article.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.heima.model.article.dtos.ArticleHomeDto;
import com.heima.model.article.pojos.ApArticle;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * @author brianxia
 * @version 1.0
 * @date 2022-10-19 10:35
 */
public interface ApArticleMapper extends BaseMapper<ApArticle> {
    //status 不传 代表加载首页  status = 1 加载更多 2加载更新
    public List<ApArticle> selectArticleList(IPage<ApArticle> page,
                                             @Param("dto") ArticleHomeDto dto,
                                             @Param("status") Short status);

    public List<ApArticle> selectArticleListByDate(@Param("date") LocalDate date);

    public Long updateBehaviorCount(@Param("likes")int likes,
                                    @Param("comment")int comment,
                                    @Param("views")int views,
                                    @Param("collect")int collection,
                                    @Param("articleId") long articleId);
}
